<template>
  <div class="demo">
    <el-table
      :data="tableData"
      style="width: 100%">
      <el-table-column
        prop="PRODUCTID"
        label="卷号"
        width="180"/>
      <el-table-column
        prop="STEEL_GRADE"
        label="钢种"
        width="180"/>
      <el-table-column
        prop="EN_THICK"
        label="入口厚度"/>
      <el-table-column
        prop="EX_THICK"
        label="入口厚度"/>
      <el-table-column
        prop="EN_WIDTH"
        label="入口宽度"/>
      <el-table-column
        prop="EX_WIDTH"
        label="出口宽度"/>
      <el-table-column
        prop="CREATE_TIME"
        label="时间"/>
    </el-table>
  </div>
  
</template>

<script>
import { post } from '@/lib/Util'
export default {
  name: 'Demo',
  components: {},
  data() {
    return {
      nowTime: '',
      parentTitle: '传给子组件的title',
      tableData: []
      // tableData: [
      //   {
      //     date: '2016-05-03',
      //     name: '王小虎',
      //     address: '上海市普陀区金沙江路 1518 弄'
      //   },
      //   {
      //     date: '2016-05-02',
      //     name: '王小虎',
      //     address: '上海市普陀区金沙江路 1518 弄'
      //   },
      //   {
      //     date: '2016-05-04',
      //     name: '王小虎',
      //     address: '上海市普陀区金沙江路 1518 弄'
      //   },
      //   {
      //     date: '2016-05-01',
      //     name: '王小虎',
      //     address: '上海市普陀区金沙江路 1518 弄'
      //   },
      //   {
      //     date: '2016-05-08',
      //     name: '王小虎',
      //     address: '上海市普陀区金沙江路 1518 弄'
      //   },
      //   {
      //     date: '2016-05-06',
      //     name: '王小虎',
      //     address: '上海市普陀区金沙江路 1518 弄'
      //   },
      //   {
      //     date: '2016-05-07',
      //     name: '王小虎',
      //     address: '上海市普陀区金沙江路 1518 弄'
      //   }
      // ]
    }
  },
  created() {},
  mounted() {
    this.nowTime = new Date()
    this.test()
    this.test2()
  },
  methods: {
    async test() {
      let res = await post('/aps/DB_Query', {
        sql: 'SELECT * FROM TB_PLTCM_RES T @where ',
        '@where': '',
        db: 'MYSQL_SELF'
      })
      this.tableData = res.data
    },
    async test2() {
      let res = await post('/aps/DB_Query', {
        sql: 'SELECT * FROM FLATNESS T @where ',
        '@where': "WHERE T.PRODUCTID = '233106942' ORDER BY T.X ASC",
        db: 'MYSQL_SELF'
      })
    }
  }
}
</script>

<style scoped>
</style>
